<template>
    <div>
        <v-header></v-header>
        <search-bar></search-bar>
        <coupon-list ref="child" v-bind:typeShow="true" filterCon="true" showInner="true" rootType="foodClass"></coupon-list>
    </div>
</template>
<script>
    import header from '../../componentes/global/header.vue'
    import searchBar from '../../componentes/global/search_bar.vue'
    import couponList from '../../componentes/global/couponList.vue'
    import * as types from '../../vuex/types.js'
    export default {
        name:'coupon',
        beforeCreate(){

        },
        components:{
            couponList,
            'v-header':header,
            searchBar
        },
        created(){
            this.$store.commit("search_key","");
        },
        beforeRouteLeave(to, from, next) {
          // 清空筛选里的数据
            this.$store.commit('couponScreenChoose', {})
            this.$store.commit('couponDistanceChoose', '')
            next()
        },
        mounted:function(){
            let me = this;
            this.$nextTick(function () {
                this.$store.commit(types.HEAD_TEXT,me.$route.query.type);
                this.$store.commit(types.HEAD_BACK_ICON,true);//显示返回按钮
                this.$store.commit(types.HEAD_MES_ICON,false);//隐藏消息按钮
            })

        },
        methods:{

        }
    }

</script>
